Skip to content

fix: add a --version flag to the CLI (#1)#4

Open
aidandaly24 wants to merge 2 commits intomainfrom
loopy/issue-1
Open

fix: add a --version flag to the CLI (#1)#4
aidandaly24 wants to merge 2 commits intomainfrom
loopy/issue-1

Conversation

@aidandaly24
Copy link
Copy Markdown
Owner

Summary

This PR adds explicit support for the --version flag to the CLI, fulfilling the requirements in issue #1.

Changes

src/cli/cli.ts

  • Made the version option explicit with -V, --version flags and a clear description "Output the current version"
  • The version is read from package.json via the existing PACKAGE_VERSION constant in constants.ts

src/cli/__tests__/cli.test.ts (new file)

  • Added unit tests to verify:
    • --version flag outputs the correct version and exits
    • -V flag (short form) also works correctly
    • The version option is configured with the correct flags and description

Acceptance Criteria

  • ✅ Running agentcore --version prints the version number (e.g., 0.3.0-preview.5.1)
  • ✅ The version is read from package.json via the PACKAGE_VERSION constant
  • ✅ The flag exits immediately after printing

Testing

Run the tests with:

npm test

Closes #1

- Make the version option explicit with `-V, --version` flags
- Add description "Output the current version" for clarity
- The version is read from package.json via PACKAGE_VERSION constant
@github-actions github-actions Bot added the size/s PR size: S label Mar 13, 2026
@github-actions
Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 36.25% 3949 / 10892
🔵 Statements 35.78% 4158 / 11618
🔵 Functions 35.61% 769 / 2159
🔵 Branches 33.89% 2541 / 7496
Generated in workflow #13 for commit 2b3c766 by the Vitest Coverage Report Action

@aidandaly24 aidandaly24 changed the title fix: Add a --version flag to the CLI (#1) fix: add a --version flag to the CLI (#1) Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --version flag to the CLI

1 participant